package test;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

import main.process.FtpRequest;

public class Serveur extends Thread 
{
	
	private ServerSocket serverSocket;
	private Socket clientSocket;
	
	
	public Serveur()
	{
		try {
			this.serverSocket = new ServerSocket(5555);
		} catch (IOException e) {
			System.err.println("Connection error to server");
			e.printStackTrace();
		}
	}
	

	
	
	public void run()
	{
		while (true)
		{
			System.out.println("");
			try {
				this.clientSocket = this.serverSocket.accept();
				new Thread(new FtpRequest(this.clientSocket)).start();
			} catch (IOException e) {
				System.out.println(e.getMessage());
			}
			
		}
	}
	
}
